import request from '@/utils/request'

// 获取经纪人列表数据
export const getagentsApi = (params) => {
  return request({
    url: '/agents',
    params
  })
}

// 获取经纪人数量
export const agentsCount = (params) => {
  return request({
    url: '/agents/count',
    params
  })
}

// 新增经纪人
export function addagents(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}
// 编辑经纪人
export function editAgents(data) {
  return request({
    url: `/agents/${data.id}`,
    method: 'put',
    data
  })
}
// 根据id获取经纪人
export function getAgentsId(id) {
  return request({
    url: `/agents/${id}`
  })
}

// 根据id删除经纪人
export function delAgentsId(id) {
  return request({
    url: `/agents/${id}`,
    method: 'delete'
  })
}
